/*
* @Author: Flora
* @Date:   2019-01-17 10:18:22
* @Last Modified by:   Flora
* @Last Modified time: 2019-01-19 17:43:52
*/
var _mm = require('util/mm.js');
var _cart = {
	listCart : function(resolve, reject){
		_mm.request({
			url : _mm.getServerUrl('/list_cart.do'),
			success : resolve,
			error : reject
		});
	},
	addCart : function(productInfo, resolve, reject){
		_mm.request({
			url : _mm.getServerUrl('/add_cart.do'),
			data : {
				productId 	: productInfo.productId,
				quantity 	: productInfo.quantity
			},
			method : 'POST',
			success : resolve,
			error : reject
		})
	}
};
module.exports = _cart;